package com.example.p214osenv;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class P214OsEnvApplication {
    private static final Logger log =
            LoggerFactory.getLogger(P214OsEnvApplication.class);

    public static void main(String[] args) {
        //SpringApplication.run(P214OsEnvApplication.class, args);
        ApplicationContext ctx =SpringApplication.run(P214OsEnvApplication.class, args);
        Environment env = ctx.getBean(Environment.class);
        log.info("Configured application timeout value: "+ env.getProperty("app.timeout"));
    }
}
